﻿using System;
using ArtMath.Core.Data;
using ArtMath.Setting;

namespace ArtMath.Component.Point
{
    /// <summary>
    /// 直角坐标系原点
    /// </summary>
    [Serializable]
    public class RectangularCoordinateOriginPoint : RPoint_Fixed
    {
        public RectangularCoordinateOriginPoint(SketchPad pad) : base(pad, pad.Coordinate.OfTranslator("RectangularCoordinateOrigin"), false)
        {
            OutlineColor = Settings.Instance.OriginPointOutlineColor;
            SpareCoordinate = pad.Coordinate.XYToPxy(new PointD(0, 0));
        }
        public override void ConvertType(ToolTypeName targetType)
        {
            //坐标系原点不支持切换点类型
        }
        public override void Move(PointD location, bool isCompulsive = false, Base sender = null)
        {
            Pad.Coordinate.OriginCoordinate.SetFromPointD(PointD.FromPoint(Pad.PxyToMouseLocation(location)));
        }
    }
}
